package com.bnzj.cloud.auth.extend;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @ClassName BCryptPasswordEncoderExtend
 * @Description 通过外部token获取到用户信息后，因为获取不到用户密码
 * @Author
 * @Date 2020/3/24
 * @Version V1.0
 **/
public class BCryptPasswordEncoderExtend extends BCryptPasswordEncoder {
    public BCryptPasswordEncoderExtend(){
        super();
    }
    public BCryptPasswordEncoderExtend(int strength){
        super(strength);
    }
    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return AuthServerLoginTypeHandler.isLoginThroughExternal() || super.matches(rawPassword, encodedPassword) ;
    }
}
